﻿/*=================================================================
* 版权信息：Copyright (C) 2005-2011 捷点科技 All Rights Reserved.
* 文件名称：CNVP_Column.cs
* 创建标识：曾乃强 15158756652 2011-03-18 01:03:04
* 修改标识：
* 功能描述：
===================================================================*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using CNVP.Framework;
using CNVP.Framework.Helper;

namespace CNVP.JShop.BLL 
{
    /// <summary>
    /// 对*CNVP_Column*操作(针对业务层)的实现
    /// </summary>
    public class CNVP_Column
    {
        DAL.CNVP_Column dal = new DAL.CNVP_Column();
        
        #region BLL
        #region 添加
        /// <summary>
        /// 添加
        /// </summary>
        public int Add_CNVP_Column(Model.CNVP_Column obj)
        {
            return dal.Insert(obj);
        }
        #endregion
        
        #region 修改
        /// <summary>
        /// 修改
        /// </summary>
        public int Update_CNVP_Column(Model.CNVP_Column obj)
        {
            return dal.Update(obj);
        }
        #endregion
        
        #region 删除
        /// <summary>
        /// 删除
        /// </summary>
        public int Delete_CNVP_Column(Model.CNVP_Column obj)
        {
            return dal.Delete(obj);
        }
        
        /// <summary>
        /// 删除,生成列的主键列构成的参数列表
        /// </summary>
        public int Delete_CNVP_Column(int ID)
        {
            return this.Delete_CNVP_Column(new Model.CNVP_Column() {
            
                 ID=ID
            });
        }
        #endregion 
        
        /// <summary>
        /// 查看单个
        /// </summary>
        public Model.CNVP_Column GetSingle_CNVP_ColumnById(int ID)
        {
            return dal.LoadById(ID);
        }

        /// <summary>
        /// 查询查看 
        /// </summary>
        /// <param name="sqlWhere">sql where语句</param>
        /// <returns></returns>
        public List<Model.CNVP_Column> GetAll_CNVP_Column(string sqlWhere)
        {
            return dal.LoadAll(sqlWhere);
        }
        /// <summary>
        /// 读取类型下最新一条栏目ID
        /// </summary>
        /// <param name="moduleType">栏目类型</param>
        /// <returns>栏目ID</returns>
        public String GetTopColumnID(int moduleType)
        {
            return dal.GetTopColumnID(moduleType);
        }
        /// <summary>
        /// 查询查看 top
        /// </summary>
        /// <param name="sqlWhere">sql where语句</param>
        /// <returns></returns>
        public List<Model.CNVP_Column> GetAll_CNVP_Column(int topNum,string sqlWhere)
        {
            return dal.LoadAll(topNum,sqlWhere);
        }

        /// <summary>
        /// 查看全部
        /// </summary>
        public List<Model.CNVP_Column> GetAll_CNVP_Column()
        {
            return this.GetAll_CNVP_Column("");
        }
        #endregion

        public DataTable GetPage(string PageName, int PageIndex, int PageSize, out int RecordCount, out int PageCount, params SQLConditionInfo[] SqlCondition)
        {
            return dal.GetPage(PageName, PageIndex, PageSize, out RecordCount, out PageCount, SqlCondition);
        }

        public string GetColumnPath(string Url, int ParentID)
        {
            return dal.GetColumnPath(Url, ParentID);
        }
        public DataTable GetColumnInfo(int ColumnID)
        {
            return dal.GetColumnInfo(ColumnID);
        }
        public DataTable GetTopColumnInfo(int moduleType)
        {
            return dal.GetTopColumnInfo(moduleType);
        }
        public DataTable GetColumnInfoForTemplate(int ColumnID)
        {
            return dal.GetColumnInfoForTemplate(ColumnID);
        }
        public DataTable GetChildColumnDt(int ParentID)
        {
            return dal.GetChildColumnDt(ParentID);
        }
        public DataTable GetChildColumnDt(int ParentID,int columnType)
        {
            return dal.GetChildColumnDt(ParentID, columnType);
        }
        public int GetColoumnTemplateType(int columnID)
        {
            return dal.GetColoumnTemplateType(columnID);
        }

        public DataTable ColumnOperate(Boolean ShowAll, Int32 ParentID)
        {
            return dal.ColumnOperate(ShowAll, ParentID);
        }
        public DataTable ColumnOperate(Int32 typeID, Boolean ShowAll, Int32 ParentID)
        {
            return dal.ColumnOperate(typeID, ShowAll, ParentID);
        }
        /// <summary>
        /// 判断是否存在子类
        /// </summary>
        /// <param name="ParentID"></param>
        /// <returns></returns>
        public Boolean IsChildMenu(Int32 parentID)
        {
            return dal.IsChildMenu(parentID);
        }
        /// <summary>
        /// 判断是否存在子类
        /// </summary>
        /// <param name="parentID"></param>
        /// <param name="typeID"></param>
        /// <returns></returns>
        public Boolean IsChildMenu(Int32 parentID, Int32 typeID)
        {
            return dal.IsChildMenu(parentID, typeID);
        }
                /// <summary>
        /// 获取栏目导航(返回全部)
        /// </summary>
        /// <param name="parentID">父栏目ID</param>
        /// <returns></returns>
        public DataTable GetColumnList(Int32 parentID)
        {
            return dal.GetColumnList(parentID);
        }
        /// <summary>
        /// 获取栏目导航(返回全部)
        /// </summary>
        /// <param name="typeID">栏目类型ID</param>
        /// <param name="parentID">父栏目ID</param>
        /// <returns></returns>
        public DataTable GetColumnList(Int32 typeID, Int32 parentID)
        {
            return dal.GetColumnList(typeID, parentID);
        }
        /// <summary>
        /// 修改,支付方式
        /// </summary>
        public int Update_CNVP_ColumnPayWay(Model.CNVP_Column obj)
        {
            return dal.UpdatePayWay(obj);
        }

    }
}

